package com.ylxn.chapter01;

/**
 * interrupted打断阻塞线程
 */
public class demo04 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(()->{
            System.out.println("thread-01 is running");
            try {
                Thread.sleep(50000);//wait join
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"thread-01");
        t1.start();
        Thread.sleep(1000);
        System.out.println("interrupting");
        t1.interrupt();
    }
}
